package com.feiren.o2o.extjs.datagrid.datasource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/extjs/datagrid/datasource")
public class DatagridDatasourceController {

	@Autowired
	private DatagridDatasource datagridDatasource;

	@RequestMapping
	public String get(@RequestParam("template") String template, @RequestParam(value = "page") int page,
			@RequestParam(value = "start") int start, @RequestParam(value = "limit") int limit) {
		return datagridDatasource.execute(template, start + 1, start + limit);
	}

}
